package com.googlecode.rjm.model.enumerations;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.googlecode.rjm.model.Persistent;

@Entity
@Table(name="enumerations")
@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING)
public abstract class Enumeration extends Persistent {
	
	private static final long serialVersionUID = 1L;

	@Id
	private Integer id;

	private String name;
	
	private Integer position;

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getPosition() {
		return this.position;
	}

	public void setPosition(Integer position) {
		this.position = position;
	}
	
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Enumeration [id=");
		builder.append(id);
		builder.append(", name=");
		builder.append(name);
		builder.append(", position=");
		builder.append(position);
		builder.append("]");
		return builder.toString();
	}

}
